package tpenchere.ui.contents;

import java.util.List;

import javax.swing.JPanel;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import com.jgoodies.forms.factories.FormFactory;
import javax.swing.JLabel;
import javax.swing.JMenuBar;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JToolBar;

import org.jdesktop.swingx.JXStatusBar;

import tpenchere.controllers.ControllerInterface;
import tpenchere.controllers.RegisterController;
import tpenchere.ui.AbstractView;
import tpenchere.ui.verifier.NotBlankVerifier;

public class RegisterWindow extends AbstractView {
	
	private static final long serialVersionUID = 3895643825121654193L;
	
	private JTextField login;
	private JTextField lastname;
	private JTextField firstname;
	private JTextField address;
	private JTextField address2;
	
	private RegisterController controller;
	
	public RegisterWindow() {
		controller = new RegisterController(this);
		setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("default:grow"),},
			new RowSpec[] {
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,}));
		
		JLabel lblIdentifiant = new JLabel("Login");
		add(lblIdentifiant, "2, 2, right, default");
		
		login = new JTextField();
		add(login, "4, 2, left, default");
		login.setColumns(10);
		login.setInputVerifier(new NotBlankVerifier());
		
		JLabel lblNom = new JLabel("Nom");
		add(lblNom, "2, 4, right, default");
		
		lastname = new JTextField();
		add(lastname, "4, 4, left, default");
		lastname.setColumns(10);
		lastname.setInputVerifier(new NotBlankVerifier());
		
		JLabel lblPrnom = new JLabel("Pr\u00E9nom");
		add(lblPrnom, "2, 6, right, default");
		
		firstname = new JTextField();
		add(firstname, "4, 6, left, default");
		firstname.setColumns(10);
		
		JLabel lblAdresse = new JLabel("Adresse");
		add(lblAdresse, "2, 8, right, default");
		
		address = new JTextField();
		add(address, "4, 8, left, default");
		address.setColumns(10);
		address.setInputVerifier(new NotBlankVerifier());
		
		address2 = new JTextField();
		add(address2, "4, 10, left, default");
		address2.setColumns(10);
		
		JButton btnSenregistrer = new JButton(controller.getActionMap().get("view.register.button.register"));
		add(btnSenregistrer, "4, 12, left, default");
	}
	@Override
	public ControllerInterface getController() {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public JMenuBar getMenuBar() {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public JXStatusBar getStatusBar() {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public List<JToolBar> getToolbars() {
		// TODO Auto-generated method stub
		return null;
	}
	public JTextField getLogin() {
		return login;
	}
	public JTextField getLastname() {
		return lastname;
	}
	public JTextField getFirstname() {
		return firstname;
	}
	public JTextField getAddress() {
		return address;
	}
	public JTextField getAddress2() {
		return address2;
	}

}
